{extend name="template/base" /}
{block name="nav"}{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="updateclass" method="post" action="{:\\think\\Url::build('addOrUpdate')}">
            <input type="text" class="input-text" value="{$supplier.id ?? ''}" placeholder="" name="id" " style="width:0;height:0">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.name ?? ''}" placeholder="" name="name" datatype="s" nullmsg="请填写供应商名称">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>联系人：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.linkman ?? ''}" placeholder="" name="linkman" datatype="s" nullmsg="请填写联系人">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>手机号码：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.mobile ?? ''}" placeholder="" name="mobile" datatype="m" nullmsg="请填写手机号码">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">座机：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.phone ?? ''}" placeholder="" name="phone" ignore="ignore" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">传真：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.fax ?? ''}" placeholder="" name="fax" ignore="ignore" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">地址：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.address ?? ''}" placeholder="" name="address" ignore="ignore" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">邮编：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.zip_code ?? ''}" placeholder="" name="zip_code" ignore="ignore" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">备注：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{$supplier.remarks ?? ''}" placeholder="" name="remarks" ignore="ignore" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="cancelAction();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__STATIC__/admin/lib/Validform/5.3.2/Validform.min.js"></script>
<!--<script type="text/javascript" src="__STATIC__/admin/js/jquery-2.1.0.min.js"></script>-->
<script>
    $(function () {
        $("#updateclass").Validform({
            tiptype:2,
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                if(ret.code){
                    layer.msg(ret.msg);
                }
                else{
                    layer.msg('操作成功',{time:2000},'',location.href = '/index/supplier/index');
//                    location.href = '{$Request.get.callback ?: \\think\\Url::build("/index/product/classShow")}';
                }
            }
        });
//        window.location.href = "/index/user/show";
    });
    function cancelAction(){
        window.location.href = "/index/supplier/index";
    }

</script>
{/block}